package com.happy.study.controller;

import com.happy.study.entity.CategoryEntity;
import com.happy.study.servier.ICategoryService;
import com.happy.study.util.ResultBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping ("/category")
public class CategoryController {


    @Resource
    private ICategoryService iCategoryService;

    @RequestMapping ("/queryList")
    public ResultBody<CategoryEntity> queryList ( CategoryEntity categoryEntity ) {
        List<CategoryEntity> categoryEntities = iCategoryService.queryList ( categoryEntity );
        return ResultBody.success ( categoryEntities, categoryEntities.size () );
    }

}
